<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<link rel="stylesheet" href="<%=path%>/css/manager/news.css">
<link rel="stylesheet" href="<%=path%>/css/page.css">
<script type="text/javascript"
	src="<%=path%>/js/manager/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/js/manager/news.js"></script>
<script type="text/javascript" src="<%=path%>/js/page.js"></script>
<title>新闻中心管理页</title>
</head>
<body>
	<!--
			页面重复使用表
			新闻，要闻，公告通知；
			论坛管理：理事动态；
		-->
		<!--
        	作者：offline
        	时间：2016-12-22
        	描述：新闻内容头部（统一，部分二级字体颜色单独修改）
        -->
		<div class="news_div1">
			<div class="news_div1_div1">新闻中心管理</div>
			<div class="news_div1_div2">
				<a href="<%=path%>/newsctr/newslist.htm?pageIndex=1&pageSize=10&newsType=1" class="news_div1_div2_div1 <c:if test="${news.newsType==1}">ablack</c:if>">新闻动态</a>
				<a>|</a>
				<a href="<%=path%>/newsctr/newslist.htm?pageIndex=1&pageSize=10&newsType=2" class="news_div1_div2_div2 <c:if test="${news.newsType==2}">ablack</c:if>">近期要闻</a>
				<a>|</a>
				<a href="<%=path%>/newsctr/newslist.htm?pageIndex=1&pageSize=10&newsType=3" class="news_div1_div2_div3 <c:if test="${news.newsType==3}">ablack</c:if>">公告通知</a>
			</div>
		</div>
	<!--
        	作者：offline
        	时间：2016-12-22
        	描述：内容
        -->
	<div class="news_div2">
		<form action="newslist.htm" id="sform" method="post">
			<input class="news_div2_in1" type="text" placeholder="标题/关键词"
				name="condition" id="condition" value="${news.condition}" /> <input
				class="news_div2_in2" type="submit" value="查找"
				onclick="return submitCheck()" /> <input type="hidden"
				id="pageIndex" name="pageIndex" value="${news.pageInfo.pageIndex}" />
			<input type="hidden" id="pageSize" name="pageSize"
				value="${news.pageInfo.pageSize}" />
			<input type="hidden" id="newsType" name="newsType"
				value="${news.newsType}" />
			<input type="hidden" id="markManage" name="markManage"
				value="0" />
			<input type="hidden" id="newsId" name="newsId"
				value="0" />
				
		</form>
	</div>
	<div class="news_div3">
		
		<c:if test="${news.newsType==1}"><input class="news_div3_in1" type="button" onclick="manage(1,0)"/> </c:if>
				<c:if test="${news.newsType==2}"><input class="news_div3_in1a" type="button" onclick="manage(1,0)"/></c:if>
				<c:if test="${news.newsType==3}"><input class="news_div3_in1b" type="button" onclick="manage(1,0)"/> </c:if>
				<c:if test="${news.newsType==4}"><input class="news_div3_in1c" type="button" onclick="manage(1,0)"/></c:if>
		<div class="news_div3_div1">
			<div class="news_div3_div1_div1">
				<div class="news_div3_div1_div1_div1">
				<c:if test="${news.newsType==1}">新闻动态</c:if>
				<c:if test="${news.newsType==2}">近期要闻</c:if>
				<c:if test="${news.newsType==3}">公告通知</c:if>
				<c:if test="${news.newsType==4}">理事动态</c:if>标题
				</div>
				<div class="news_div3_div1_div1_div2">发布状态</div>
				<div class="news_div3_div1_div1_div3">发布时间</div>
				<div class="news_div3_div1_div1_div4">操作</div>
			</div>
			<div class="news_div3_div1_div2">
				<c:forEach items="${list}" var="newses">
					<div class="news_div3_div1_div2_div1  <c:if test="${newses.newsStatus==1}"> news_div3_div1_div2_div1s</c:if>">
						<div class="news_div3_div1_div2_div1_div1"><a href="javascript: manage(3,'${newses.newsId}')">${newses.newsTheme}</a></div>
						<div class="news_div3_div1_div2_div1_div2">
							<c:if test="${newses.newsStatus==1}">待发布</c:if>
							<c:if test="${newses.newsStatus==2}">已发布</c:if>
						</div>
						<div class="news_div3_div1_div2_div1_div3">
							<fmt:formatDate value="${newses.newsPublisTime}"
								pattern="yyyy-MM-dd HH:mm:ss" />
						</div>
						<div class="news_div3_div1_div2_div1_div4">
							<a href="javascript: manage(3,'${newses.newsId}')">查看</a> <a
								href="javascript: manage(2,'${newses.newsId}')">编辑</a> <a
								href="javascript: manage(4,'${newses.newsId}')">删除</a>
						</div>
					</div>
				</c:forEach>
			</div>
		</div>
		<div class="bbs_mist_div2_div3">
        		<select onchange="setPageSize()" id="pageSize_sel">
        			<option
					<c:if test="${banner.pageInfo.pageSize==10}">selected="selected"</c:if>>10</option>
				<option
					<c:if test="${banner.pageInfo.pageSize==15}">selected="selected"</c:if>>15</option>
				<option
					<c:if test="${banner.pageInfo.pageSize==20}">selected="selected"</c:if>>20</option>
        		</select>
        		<span>/每页，共${news.pageInfo.totalRec}条记录</span>
        </div>
        <div class="page">
		<!-- 分页 -->
		<c:set value="${news.pageInfo}" var="pageInfo"></c:set>
		<%@include file="../template/pageTemplate.jsp"%>
		</div>
	</div>
</body>
<script type="text/javascript">
	//提交验证
	function submitCheck() {
		//1.搜索框去掉前后空格
		var condition = $.trim($("#condition").val());
		$("#condition").val(condition);
		return true;
	}
	//操作：type:1添加；2编辑；3查看；4删除
	function manage(type,id){
		$("#markManage").val(type);
		$("#newsId").val(id);
		$("#sform").attr("action", "tonewsmange.htm");
		$("#pageIndex").attr("name","pageInfo.pageIndex");  
		$("#pageSize").attr("name","pageInfo.pageSize");  
		if(type==4){
			if(window.confirm("确定要删除该条理事动态吗？")){
				$("#sform").attr("action", "newsmange.htm");  
	         }else{
	        	 return;
	        	 }
		}
		$("#sform").submit();
		
	}

</script>
</html>

